package com.qf.springboot1205.controller;

import com.qf.springboot1205.bean.Student;
import com.qf.springboot1205.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * IntelliJ IDEA -> springboot1205
 * 2019/12/5 20:25
 *
 * @author zmyao
 * 别看，我是渣渣。
 */
@Controller
public class JspController {
    @Autowired
    private StudentService studentService;
    @RequestMapping("/getstus")
    public String getstus(ModelMap map){
        List<Student> students = studentService.findStudents();
        map.addAttribute("students",students);
        System.out.println("111111111111");
        return  "show";
    }


}
